feat: backport /pr-loop command + merge-ready.sh from downstream - #17
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backports two pieces of the autonomous PR-loop automation that proved out downstream (in a project adapted from this framework) so any adapted project gets them out of the box.
What
.claude/scripts/merge-ready.sh(new) — merges every open PR the repo owner has APPROVED that is mergeable and fully CI-green, then deletes the branch. It never approves anything (the human Approve stays the only gate) and only merges when the approval was submitted at/after the PR's last commit (so a free private repo with no branch-protection auto-dismiss never merges commits the owner hasn't seen). Generalized for the framework: repo is derived from the git remote (override$1), the approver defaults to the repo owner login (override$APPROVER), base branch comes fromgates.jsonmerge.baseBranch. Runs as the bot (GH_BOT_TOKEN); merging ≠ approving, so the bot may merge bot-authored PRs. This is step 2 ("Merge") of the loop described indocs/USAGE.md, which until now had no script..claude/commands/pr-loop.md(new — first entry under.claude/commands/) — a slash command that idempotently (re)arms the adaptive-cadence PR-loop cron with the canonical tick prompt and runs one tick immediately. Restores the whole loop in a single/pr-loopat the start of any session (cron jobs are session-scoped and don't reliably persist). Uses only framework scripts:notify-poll.sh(poll),merge-ready.sh(merge),pr-feedback.sh(address feedback),bot-gh.sh(bot-authored PRs). No project-specific values — repo viagh repo view, base viagates.json, bot via$BOT_LOGIN.Notes
merge-ready.shlands as mode100644. It's always invoked asbash .claude/scripts/merge-ready.sh, so the missing exec bit is functionally irrelevant;chmod +xif you want parity with the other scripts.docs/USAGE.mdreferencing/pr-loopandmerge-ready.shin the PR-feedback-loop and cron sections.🤖 Generated with Claude Code